package com.colin.aiyi.dao.ImpxUtils;

import com.colin.aiyi.app.Constant;
import com.colin.aiyi.entity.response.BaseResponse;
import com.colin.aiyi.entity.Chudao;

import org.xutils.http.RequestParams;

/**
 * Created by hl on 2017/6/9.
 */

public class ImpAudioSave extends AbsServicexUtils {
    @Override
    public void onSuccess(String result) {
        super.onSuccess(result);
        BaseResponse loginResponse=gson.fromJson(result,BaseResponse.class);
        if (callback==null)
        {
            sendMsgToView(loginResponse);
        }else {
            callback.onSuccess(loginResponse);
        }
    }

    @Override
    public <V> void getObject(V v) {
        super.getObject(v);
        Chudao audio= (Chudao) v;
        RequestParams params=new RequestParams(Constant.AUDIO_save);
        params.addBodyParameter("accessToken",audio.getAccessToken());
        params.addBodyParameter("roleId",audio.getRoleId()+"");//	是	string	角色ID
        params.addBodyParameter("content",audio.getContent());//	是	string	内容
        params.addBodyParameter("urls",audio.getStrUrls());//	是	string	多个用字符串拼接
        sendToServer(params,1);
    }
}
